package com.amigo.online.provider.sync.handle.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSONObject;
import com.amigo.online.provider.sync.handle.data.redis.service.VideoRedisService;
import com.amigo.online.provider.sync.handle.service.AbstractDataHandler;
import com.amigo.online.provider.sync.handle.service.DataHandler;

/**
 * 处理Reids 中的video
 *
 * @author amigo
 */
@Service("videoRedisDataHandler")
@SuppressWarnings({"rawtypes"})
public class VideoRedisDataHandler extends AbstractDataHandler implements DataHandler {

    @Autowired
    @Qualifier("userRedisTemplate")
    RedisTemplate videoRedisTemplate;

    @Autowired
    VideoRedisService videoRedisService;

    @Override
    public void updateHandle(JSONObject newObject, JSONObject oldObjecet) {
        long id = newObject.getLongValue("id");
        long result = 0;
        for (String temp : oldObjecet.keySet()) {
			/*if (VIDEO_UPDATE_COL.contains(temp)) {
				result = videoRedisService.deleteObject(id);
				if(result == 0) {
					logger.error("更新mongoUser表数据失败！更新数据ID: " + id);				
					//kafkaMessageSender.FailLogSend("", "");
				}
				break;
			}*/
        }
    }

    /**
     * 暂时不做任何处理
     */
    @Override
    public void insertHandle(JSONObject newObject) {

    }

    @Override
    public void updateInfoByIdThroughHashMap(Long id, Map<String, Object> updateMap) {
        //  Auto-generated method stub

    }

    @Override
    public void insertObject(Object source) {
        //  Auto-generated method stub

    }

}
